#include<iostream>
#include<set>//红黑树
#include"global.hpp"
#include<string>


struct Student
{
    int id;
    std::string name;
};
bool operator<(const Student &s1,const Student &s2)
{

    return s1.id<s2.id;
}
std::ostream& operator<<(std::ostream& os,const Student&s)
{
    std::cout<<s.id<<" "<<s.name<<std::endl;
    return os;
}
int main()
{
    //放置自定义类型，需要重载<  要全局重载
    std::multiset<Student> s;//从大到小排
    s.insert({1,"zhangsan"});
    s.insert({3,"lisi"});
    s.insert({2,"wangwu"});
        //   auto ite=s.find(1);//按值查返回迭代器
        //   std::cout<<*ite<<std::endl;
    s.insert({1,"zhaoliu"});//不能插入相同的值

    auto ite=s.find({1,""});//multiset只能找第一个
    std::cout<<*ite<<std::endl;
    Print(s);
    return 0;
}